<template>
	<swiper :autoplay="true" :interval="3000" :duration="1000">
		<swiper-item v-for="item in bannerList" :key="item.imageUrl">
				<view class="banner">
					<image :src="item.imageUrl" mode="widthFix"></image>
				</view>
		</swiper-item>
	</swiper>
</template>

<script>
	import {getBanner} from "../ajax/ajax.js"
	export default {
		data() {
			return {
				bannerList:[]
			}
		},
		created() {
			getBanner().then((res) => {
				// console.log(res.banners);
				this.bannerList = res.banners
			})
		},
	}
</script>

<style>
	swiper{
		height: 230rpx;
		margin:0 auto;
		border-radius: 15rpx;
		overflow: hidden;
	}
	.banner image{
		width: 100%;
		border-radius: 15rpx;
	}
</style>
